﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfApp_Binding
{
    /// <summary>
    /// Main2Window.xaml 的交互逻辑
    /// </summary>
    public partial class Main2Window : Window
    {
        public Main2Window()
        {
            InitializeComponent();
            /*
             * 只要是WPF窗体,那么默认都会有一个上下文 DataContext
             */
            this.DataContext = new Dome()
            {
                Age = 11,
                Name = "张三"
            };
        }
    }


    public class Dome
    {
        public string Name { get; set; }

        public int Age { get; set; }
    }

}
